from base.base import Base
from time import sleep
from selenium.webdriver.common.by import By

class SousuoPage(Base):

    guanzhu=(By.ID,'com.kongfz.app:id/lav_2')

    sousuokuang=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.FrameLayout[2]/android.view.ViewGroup/android.view.ViewGroup/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout')

    sousuoanniu=(By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tv_search"]')

    dy=(By.ID,'com.kongfz.app:id/lav_2')

    def sousuoyewu(self,password):
        self.loc_ele(self.guanzhu).click()
        sleep(2)

        self.loc_ele(self.sousuokuang).send_keys(password)
        sleep(2)

        self.loc_ele(self.sousuoanniu).click()
        sleep(2)
